home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJEMU106.ARJ / EMUSUBS.S < prev    next >
Text File  |  1992-04-08  |  2KB  |  100 lines

  1. /*
  2. ** EMU-387 Math Routines
  3. */
  4.  
  5. #define P1    8(%ebp)
  6. #define    P2    12(%ebp)
  7. #define    P3    16(%ebp)
  8.  
  9. #define SIGN(x)    (x)
  10. #define    TAG(x)    1(x)
  11. #define    EXP(x)    2(x)
  12. #define SIG(x)    4(x)
  13. #define    SIGL(x)    4(x)
  14. #define    SIGH(x)    8(x)
  15.  
  16. /*
  17. ** void r_mov(reg& s, reg& d);
  18. */
  19.     .globl _r_mov__FR3regT0
  20. _r_mov__FR3regT0:
  21.     movl    4(%esp),%ecx
  22.     movl    8(%esp),%edx
  23.     movl    (%ecx),%eax
  24.     movl    %eax,(%edx)
  25.     movl    4(%ecx),%eax
  26.     movl    %eax,4(%edx)
  27.     movl    8(%ecx),%eax
  28.     movl    %eax,8(%edx)
  29.     ret
  30.  
  31. /*
  32. ** int val_same(reg& s, reg& d)
  33. */
  34.     .globl    _val_same__FR3regT0
  35. _val_same__FR3regT0:
  36.     enter    $0,$0
  37.     movl    P1,%ecx
  38.     movl    P2,%edx
  39.     movb    SIGN(%ecx),%al
  40.     cmpb    SIGN(%edx),%al
  41.     jne    Lval_0
  42.     movw    EXP(%ecx),%ax
  43.     cmpw    EXP(%edx),%ax
  44.     jne    Lval_0
  45.     movl    SIG(%ecx),%eax
  46.     cmpl    SIG(%edx),%eax
  47.     jne    Lval_0
  48.     mov    $1,%eax
  49.     jmp    Lval_ret
  50. Lval_0:
  51.     mov    $0,%eax
  52. Lval_ret:
  53.     leave
  54.     ret
  55.  
  56. /*
  57. ** int mag_same(reg& s, reg& d)
  58. */
  59.     .globl    _mag_same__FR3regT0
  60. _mag_same__FR3regT0:
  61.     enter    $0,$0
  62.     movl    P1,%ecx
  63.     movl    P2,%edx
  64.     movw    EXP(%ecx),%ax
  65.     cmpw    EXP(%edx),%ax
  66.     jne    Lmag_0
  67.     movl    SIG(%ecx),%eax
  68.     cmpl    SIG(%edx),%eax
  69.     jne    Lmag_0
  70.     mov    $1,%eax
  71.     jmp    Lmag_ret
  72. Lmag_0:
  73.     mov    $0,%eax
  74. Lmag_ret:
  75.     leave
  76.     ret
  77.  
  78.  
  79.     .globl    _djshld
  80. _djshld:
  81.     movl    4(%esp),%eax
  82.     movl    (%eax),%ecx    // lsl
  83.     movl    4(%eax),%edx    // msl
  84.     shld    $1,%ecx,%edx
  85.     shl    $1,%ecx
  86.     movl    %ecx,0(%eax)
  87.     movl    %edx,4(%eax)
  88.     ret
  89.  
  90.     .globl    _djshrd
  91. _djshrd:
  92.     movl    4(%esp),%eax
  93.     movl    (%eax),%ecx    // lsl
  94.     movl    4(%eax),%edx    // msl
  95.     shrd    $1,%edx,%ecx
  96.     shr    $1,%edx
  97.     movl    %ecx,0(%eax)
  98.     movl    %edx,4(%eax)
  99.     ret
  100.